package com.baiytfp.hf.HFDataExchange.action.dao;

import com.baiytfp.hf.HFDataExchange.common.model.base.TableName;
import com.baiytfp.hf.baiytfp.common.db.HFPager;
import com.baiytfp.hf.baiytfp.framework.base.BaseDao;
import com.baiytfp.hf.baiytfp.hfutils.HFDBHelper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @program: HFDataExchange
 * @description: 接口信息Dao
 * @author: zhenKang
 * @create: 2018-12-07 11:57
 */
@Repository
public class InterfaceDAOImpl extends BaseDao {
    /**
     * 接口信息列表 (interface_type 类型(1:主动接口  0:被动接口 ))
     * @param hfPager
     * @return
     * @throws Exception
     */
    public List<Map> listInterface(HFPager hfPager) throws Exception {
        String sql = "select * from "+ TableName.INTERFACE_INFO;
        String where = " where interface_type = ? ";
        List<Map> mapList = HFDBHelper.list_split(sql + where, Map.class, hfPager, hfPager.getParam("interface_type"));
        return mapList;
    }
}
